﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<GiveGraphModel.ServiceRequest>" %>
<%@ Import Namespace="GiveGraphModel" %>
<%@ Import Namespace="WebApp.Models" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Respond Service Request</h2>

    <p><b>Organization Interested: </b><%: Model.Organization.Name %></p>
    <p><b>Service Type: </b><%: Model.Category.Name %></p>
    <% if (Model.SpecialtyAreas != null && Model.SpecialtyAreas.Count > 0)
       {%>
        <% Html.RenderPartial("Container", new Container("Specialty Areas", "ListBox", new Tuple<string, IEnumerable<SelectListItem>>("specialty", Model.SpecialtyAreas.Select(p => new SelectListItem { Text = p.Name })))); %>
                
    <%
       }%>

    <% if (Model.TypeOfVolunteering != null && Model.TypeOfVolunteering.Count > 0)
       {%>

        <% Html.RenderPartial("Container", new Container("Type of Volunteering", "ListBox", new Tuple<string, IEnumerable<SelectListItem>>("typevolunterring", Model.TypeOfVolunteering.Select(p => new SelectListItem { Text = p })))); %>
        
    <%
       }%>
    <%--<% Html.RenderPartial("Container", new Container("Availability Schedule", "Scheduler", new List<Schedule>())); %>  --%>           

    
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MetaTagsContent" runat="server">
<script>
    var requestId = <%: Model.ServiceRequestId %>;
    $(function () 
    { 
        var container = $('#main');
        $('<a></a>').attr("href", "/Service/AcceptRequest?requestId="+requestId).button().text("Accept").appendTo(container); 
    });
    $(function () 
    { 
        var container = $('#main'); 
        $('<a></a>').attr("href", "/Service/RejectRequest?requestId="+requestId).button().text("Reject").appendTo(container); 
    });
</script>
</asp:Content>
